# 本项目生成一个静态的库
cmake_minimum_required(VERSION 3.16)

project(navigator)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
)

add_subdirectory(a_star)
add_subdirectory(a_star_normal)
add_subdirectory(jps_normal)

# aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SRC)


# add_library(${PROJECT_NAME} STATIC      # SHARED 动态库；STATIC 静态库
#     $<TARGET_OBJECTS:a_star>
#     $<TARGET_OBJECTS:a_star_normal>
#     $<TARGET_OBJECTS:jps_normal>
# )

link_directories(
    ${a_star_BINARY_DIR}
    ${a_star_normal_BINARY_DIR}
    ${jps_normal_BINARY_DIR}
)

add_library(${PROJECT_NAME} STATIC 
    $<TARGET_OBJECTS:a_star>
    $<TARGET_OBJECTS:a_star_normal>
    $<TARGET_OBJECTS:jps_normal>
)

add_dependencies(${PROJECT_NAME} a_star)
add_dependencies(${PROJECT_NAME} a_star_normal)
add_dependencies(${PROJECT_NAME} jps_normal)

target_link_libraries(${PROJECT_NAME}
    a_star
    a_star_normal
    jps_normal
)



set_target_properties(${PROJECT_NAME} PROPERTIES LINK_OPTIONS -s) # strip

# install(TARGETS ${PROJECT_NAME}
#     RUNTIME DESTINATION ${INNER_BIN_DIR}
#     LIBRARY DESTINATION ${INNER_LIB_DIR}
#     ARCHIVE DESTINATION ${INNER_LIB_DIR}
# )